<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<div class="aui-header-2 aui-gutter-column-md">
    <h2>{{ 'common_basic_info_label' | i18n }}</h2>
</div>
<lv-form [lvLabelColon]="false">
    <lv-form-column *ngFor="let column of formItems" lvWidth="50%">
        <ng-container *ngFor="let item of column">
            <lv-form-item>
                <lv-form-label>{{ item.label }}</lv-form-label>
                <lv-form-control>
                    <ng-container [ngSwitch]="item.key">
                        <ng-container *ngSwitchCase="'status'">
                            <ng-container
                                *ngIf="!_includes([copyStatus.normal.value,copyStatus.invalid.value,copyStatus.verifying.value],rowData?.status); else elseTemplate">
                                <aui-status [value]="rowData?.status" type="snapshotCopyStatus">
                                </aui-status>
                            </ng-container>
                            <ng-template #elseTemplate>
                                <aui-status [value]="rowData?.anti_status" type="detectionSnapshotStatus">
                                </aui-status>
                            </ng-template>
                        </ng-container>
                        <ng-container *ngSwitchCase="'generate_type'">
                            <span lv-overflow>
                                {{item.value | textMap: 'snapshotGeneratetype'}}
                            </span>
                        </ng-container>
                        <ng-container *ngSwitchCase="'is_security_snapshot'">
                            {{(item.value ? 'common_yes_label' : 'common_no_label') | i18n}}
                        </ng-container>
                        <ng-container *ngSwitchCase="'total_file_size'">
                            <ng-container *ngIf="_isNumber(item.value); else emptyTpl">
                                <span lv-overflow>
                                    {{item.value | capacityCalculateLabel:'1.0-0':unitconst.BYTE: true}}
                                </span>
                            </ng-container>
                        </ng-container>
                        <ng-container *ngSwitchCase="'expiration_time'">
                            <span lv-overflow>
                                {{item.value | date: 'yyyy-MM-dd HH:mm:ss' | nil}}
                            </span>
                        </ng-container>
                        <ng-container *ngSwitchDefault>
                            <span lv-overflow class="warp">{{item.value | nil}}</span>
                        </ng-container>
                    </ng-container>
                </lv-form-control>
            </lv-form-item>
        </ng-container>
    </lv-form-column>
</lv-form>
<ng-template #emptyTpl>
    --
</ng-template>